package com.xh.bussiness.tiku.controller;

import com.xh.bussiness.jingyou.service.IJYQuestionService;
import com.xh.bussiness.system.model.Dictionary;
import com.xh.bussiness.tiku.bean.dto.SubjectQuestionTypeDto;
import com.xh.bussiness.tiku.bean.request.QuestionTypeSaveRequest;
import com.xh.bussiness.tiku.model.BookChapter;
import com.xh.bussiness.tiku.model.BookVersion;
import com.xh.bussiness.tiku.model.QuestionType;
import com.xh.bussiness.tiku.model.SubjectQuestionType;
import com.xh.bussiness.tiku.service.IQuestionTypeService;
import com.xh.core.bean.AjaxResult;
import com.xh.core.constant.AjaxResultConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/*
 * @Author daiwei
 * @Description
 * @Date 2019/2/27 11:03
 **/
@Api(tags="题库-试题接口")
@RestController
@RequestMapping("/tiku/questionSource")
public class QuestionSourceController {
	@Autowired
    private IJYQuestionService quetionService;
	
	@PostMapping("/queryBySubject")
    @ApiOperation(value="根据学科查询", notes = "查询菁优网的")
    @ApiImplicitParams({
            @ApiImplicitParam(name="subject", value="学科", required = true, dataType = "String"),
    })
    public AjaxResult queryBySubject(String subject) throws Exception{
        return new AjaxResult(AjaxResultConstant.Result.SUCCESS, quetionService.queryQuestionSource(subject));
    }
}
